#!/usr/bin/env bash
set -e

# clean
npm run clean

# build
npm run build

# publish plus-com-design
# cd dist/plus-com-design
# echo "publish plus-com-design..."
# npm publish
# echo "Successfully published plus-com-design"
# cd -

# publish utils
cd packages/utils
echo "build utils..."
npm run build
echo "publish utils..."
npm publish
echo "Successfully published utils"
cd -

# publish resolver
cd packages/resolver
echo "build resolver..."
npm run build
echo "publish resolver..."
npm publish
echo "Successfully published resolver"
cd -

# publish eslint-config
cd packages/eslint-config
echo "build eslint-config..."
npm run build
echo "publish eslint-config..."
npm publish
echo "Successfully published eslint-config"
cd -

# finish
echo "✅ Publish completed"
exit
